package org.mzyyn.qr.service.auction.impl;

import org.mzyyn.qr.entity.AuctionBidRecordPO;
import org.mzyyn.qr.mapper.AuctionBidRecordMapper;
import org.mzyyn.qr.service.auction.AuctionBidRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 出价记录表 服务实现类
 * </p>
 *
 * @author lipeng
 * @since 2024-09-24
 */
@Service
public class AuctionBidRecordServiceImpl extends ServiceImpl<AuctionBidRecordMapper, AuctionBidRecordPO> implements AuctionBidRecordService {

    @Override
    public void addBidRecord(Long goodsId, String userUuid, Long price){
        AuctionBidRecordPO auctionBidRecordPO = new AuctionBidRecordPO();
        auctionBidRecordPO.setGoodsId(goodsId);
        auctionBidRecordPO.setUserUuid(userUuid);
        auctionBidRecordPO.setPrice(price);
        auctionBidRecordPO.setCreateTime(LocalDateTime.now());
        auctionBidRecordPO.setUpdateTime(LocalDateTime.now());

        this.save(auctionBidRecordPO);

    }
}
